<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
<style>

.active {
	width: 100px;
	height: 100px;
	background: green;
}
.my{	
	width: 50px;
	height: 100px;
}
.text-danger {
	background: red;
}

</style>
</head>
<body>
<div id="app">
  <div
     v-bind:class="{my:flag0, active: flag1, 'text-danger': flag2 }"
      class="my"  >
 ddd
	</div>

	<button v-on:click="click1">xx</button>
</div>
<script>
new Vue({
  el: '#app',
  data: {
  	flag0: true,
    flag1: false,
	flag2: false
  },
  methods:{
  	click1:function(event){
  		this.flag0=false;
  		this.flag1=true;
  		this.flag2=true;
  	}
  }
})
</script>
	
		
</body>
</html>